//
//  RootViewController.m
//  demo12-12
//
//  Created by king on 2017/12/13.
//  Copyright © 2017年 KC. All rights reserved.
//

#import "RootViewController.h"
#import "AViewController.h"
#import "KCKit.h"

typedef enum {
    sending,
    fail,
    success
} state;


YYSYNTH_DUMMY_CLASS(NSObject_KCDemoModel)


@interface RootViewController ()

@end

@implementation RootViewController

#pragma mark - LifeCycle

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createView];
    self.view.backgroundColor = [UIColor lightGrayColor];
}

- (void)dealloc {
    NSLog(@"♻️ Dealloc %@", NSStringFromClass([self class]));
}

#pragma mark - Setup

- (void)createView {
    
    
    NSLog(@"%d",KC_CLAMP(50, 0, 100));
    NSLog(@"%d",KC_CLAMP(5, 10, 100));
    NSLog(@"%d",KC_CLAMP(200, 10, 100));

    int a = 10;
    int b = 20;
    KC_SWAP(a, b);
    NSLog(@"%d",a);
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"push" forState:UIControlStateNormal];
    btn.frame = CGRectMake(100, 100, 100, 100);
    btn.backgroundColor =  [UIColor cyanColor];
    [btn addTarget:self action:@selector(btnClick)forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];

}

- (void)btnClick {
    
    AViewController *avc = [[AViewController alloc]init];
    [self.navigationController pushViewController:avc animated:YES];
    
}

@end
